<?php

class RegExValidator
{
	public $RegEx;
	public $Message;
	public function RegExValidator($RegEx, $Message)
	{
		$this->RegEx = $RegEx;
		$this->Message = $Message;
	}
	public function Validate($Value)
	{
		if(preg_match($this->RegEx, $Value))
			return $this->Message;
		return null;
	}
}